@declarion/react 0.65.1 → 0.66.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (467) hide show
  1. package/dist-lib/api/access-expiry.js +32 -0
  2. package/dist-lib/api/agents.js +105 -0
  3. package/dist-lib/api/auth-redirect.js +30 -0
  4. package/dist-lib/api/auth.js +67 -0
  5. package/dist-lib/api/batch.js +34 -0
  6. package/dist-lib/api/client.js +241 -0
  7. package/dist-lib/api/data.js +122 -0
  8. package/dist-lib/api/entities.js +160 -0
  9. package/dist-lib/api/events.js +120 -0
  10. package/dist-lib/api/fileReferences.js +8 -0
  11. package/dist-lib/api/params.js +20 -0
  12. package/dist-lib/api/properties.js +25 -0
  13. package/dist-lib/api/request-bounds.js +28 -0
  14. package/dist-lib/api/schema.js +71 -0
  15. package/dist-lib/api/session-renewal.js +36 -0
  16. package/dist-lib/api/status.js +17 -0
  17. package/dist-lib/app.js +262 -0
  18. package/dist-lib/components/actions/ActionButton.js +116 -0
  19. package/dist-lib/{ActionDialog-C6EG-AmC.js → components/actions/ActionDialog.js} +63 -53
  20. package/dist-lib/{ActionResultDialog.impl-BATutW8J.js → components/actions/ActionResultDialog.impl.js} +53 -48
  21. package/dist-lib/components/actions/ActionResultDialog.js +12 -0
  22. package/dist-lib/components/actions/ActionRunner.js +274 -0
  23. package/dist-lib/components/actions/ObjectActionBar.js +127 -0
  24. package/dist-lib/components/actions/PropertyGridEditor.js +202 -0
  25. package/dist-lib/components/actions/ResponsiveActionBar.js +773 -0
  26. package/dist-lib/components/actions/RowActionsKebab.js +90 -0
  27. package/dist-lib/{AgentChatPanel.impl-D5y_qEex.js → components/agents/AgentChatPanel.impl.js} +314 -362
  28. package/dist-lib/components/agents/AgentChatPanel.js +12 -0
  29. package/dist-lib/components/agents/AgentConversationDrawer.js +59 -0
  30. package/dist-lib/components/agents/AgentElicitForm.js +152 -0
  31. package/dist-lib/components/agents/AgentOpenFollower.impl.js +7 -0
  32. package/dist-lib/components/agents/AgentOpenFollower.js +12 -0
  33. package/dist-lib/components/agents/AgentPicker.js +58 -0
  34. package/dist-lib/components/agents/transcript-runs.js +52 -0
  35. package/dist-lib/components/chrome/AssociationTabs.js +176 -0
  36. package/dist-lib/components/chrome/AuditMetaStrip.js +64 -0
  37. package/dist-lib/components/chrome/Breadcrumbs.js +67 -0
  38. package/dist-lib/components/chrome/HighlightsStrip.js +39 -0
  39. package/dist-lib/{PageHeader-DiwLe7CO.js → components/chrome/PageHeader.js} +19 -15
  40. package/dist-lib/{PageShell-BJz1MiTH.js → components/chrome/PageShell.js} +3 -3
  41. package/dist-lib/components/chrome/RecordHeader.js +119 -0
  42. package/dist-lib/{headerActionZone-bef-tZZ7.js → components/chrome/headerActionZone.js} +1 -1
  43. package/dist-lib/components/detail-layout/AssociatedBlock.js +1244 -0
  44. package/dist-lib/components/detail-layout/AssociatedToolbar.js +87 -0
  45. package/dist-lib/components/detail-layout/ChildrenBlock.js +80 -0
  46. package/dist-lib/components/detail-layout/ChildrenCards.js +156 -0
  47. package/dist-lib/components/detail-layout/ChildrenList.js +135 -0
  48. package/dist-lib/components/detail-layout/ChildrenTable.js +189 -0
  49. package/dist-lib/components/detail-layout/ChildrenTimeline.js +609 -0
  50. package/dist-lib/components/detail-layout/DetailAuditStrip.js +40 -0
  51. package/dist-lib/components/detail-layout/DetailHighlights.js +54 -0
  52. package/dist-lib/{DraggableChildrenTable-Dd5SeuF6.js → components/detail-layout/DraggableChildrenTable.js} +56 -53
  53. package/dist-lib/components/detail-layout/EditableChildrenTable.js +341 -0
  54. package/dist-lib/components/detail-layout/ErrorSummary.js +89 -0
  55. package/dist-lib/components/detail-layout/EvidenceBlock.js +66 -0
  56. package/dist-lib/{FieldRow-DedGIY9R.js → components/detail-layout/FieldRow.js} +8 -7
  57. package/dist-lib/components/detail-layout/FieldsBlock.js +74 -0
  58. package/dist-lib/components/detail-layout/LayoutColumn.js +16 -0
  59. package/dist-lib/components/detail-layout/LayoutRenderer.js +54 -0
  60. package/dist-lib/components/detail-layout/LayoutRow.js +83 -0
  61. package/dist-lib/components/detail-layout/LayoutTabs.js +195 -0
  62. package/dist-lib/components/detail-layout/PropertiesBlock.js +74 -0
  63. package/dist-lib/components/detail-layout/QuickAddForm.js +81 -0
  64. package/dist-lib/components/detail-layout/SectionBlock.js +48 -0
  65. package/dist-lib/components/detail-layout/StatusesBlock.js +18 -0
  66. package/dist-lib/components/detail-layout/TimelineComposer.js +205 -0
  67. package/dist-lib/components/detail-layout/blockMeta.js +27 -0
  68. package/dist-lib/components/detail-layout/useManualColumnResize.js +94 -0
  69. package/dist-lib/components/detail-layout/useQuickAdd.js +85 -0
  70. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +295 -0
  71. package/dist-lib/components/detail-layout/widgets/JsonDiffWidget.js +107 -0
  72. package/dist-lib/components/detail-layout/widgets/MonacoJson.js +47 -0
  73. package/dist-lib/components/detail-layout/widgets/WidgetHost.js +36 -0
  74. package/dist-lib/components/detail-layout/widgets/builtins.js +10 -0
  75. package/dist-lib/components/detail-layout/widgets/canonicalizeJson.js +32 -0
  76. package/dist-lib/components/detail-layout/widgets/monacoBootstrap.js +16 -0
  77. package/dist-lib/components/detail-layout/widgets/registry.js +13 -0
  78. package/dist-lib/components/fields/BoolField.js +13 -0
  79. package/dist-lib/components/fields/EmailField.js +16 -0
  80. package/dist-lib/components/fields/EnumField.js +38 -0
  81. package/dist-lib/components/fields/FileReferenceField.js +60 -0
  82. package/dist-lib/components/fields/IntArrayField.js +83 -0
  83. package/dist-lib/components/fields/JsonField.js +51 -0
  84. package/dist-lib/components/fields/MultilangArrayField.js +56 -0
  85. package/dist-lib/components/fields/MultilangField.js +65 -0
  86. package/dist-lib/components/fields/MultilangTextField.js +65 -0
  87. package/dist-lib/components/fields/NumberField.js +64 -0
  88. package/dist-lib/components/fields/PasswordField.js +34 -0
  89. package/dist-lib/components/fields/PhoneField.js +84 -0
  90. package/dist-lib/components/fields/RefCombobox.js +112 -0
  91. package/dist-lib/components/fields/RefField.js +45 -0
  92. package/dist-lib/components/fields/RichTextField.js +225 -0
  93. package/dist-lib/components/fields/SecretField.js +34 -0
  94. package/dist-lib/components/fields/StringArrayField.js +165 -0
  95. package/dist-lib/components/fields/StringField.js +39 -0
  96. package/dist-lib/components/fields/StructureField.js +221 -0
  97. package/dist-lib/components/fields/TextField.js +76 -0
  98. package/dist-lib/components/fields/TimestampField.js +110 -0
  99. package/dist-lib/components/fields/UrlField.js +18 -0
  100. package/dist-lib/components/fields/cells/factories/badge.js +42 -0
  101. package/dist-lib/components/fields/cells/factories/boolPill.js +17 -0
  102. package/dist-lib/components/fields/cells/factories/code.js +11 -0
  103. package/dist-lib/components/fields/cells/factories/date.js +30 -0
  104. package/dist-lib/components/fields/cells/factories/email.js +26 -0
  105. package/dist-lib/components/fields/cells/factories/emptyCell.js +10 -0
  106. package/dist-lib/components/fields/cells/factories/fileReference.js +17 -0
  107. package/dist-lib/components/fields/cells/factories/host-icons.js +146 -0
  108. package/dist-lib/components/fields/cells/factories/json.js +61 -0
  109. package/dist-lib/components/fields/cells/factories/link.js +32 -0
  110. package/dist-lib/components/fields/cells/factories/markdown.js +31 -0
  111. package/dist-lib/components/fields/cells/factories/markdownPreview.js +81 -0
  112. package/dist-lib/components/fields/cells/factories/money.js +37 -0
  113. package/dist-lib/components/fields/cells/factories/multilangInline.js +35 -0
  114. package/dist-lib/components/fields/cells/factories/nextRun.js +46 -0
  115. package/dist-lib/components/fields/cells/factories/number.js +42 -0
  116. package/dist-lib/components/fields/cells/factories/passwordMask.js +23 -0
  117. package/dist-lib/components/fields/cells/factories/phone.js +35 -0
  118. package/dist-lib/components/fields/cells/factories/refLink.js +57 -0
  119. package/dist-lib/components/fields/cells/factories/richTextPreview.js +34 -0
  120. package/dist-lib/components/fields/cells/factories/statusPill.js +35 -0
  121. package/dist-lib/components/fields/cells/factories/tagList.js +44 -0
  122. package/dist-lib/components/fields/cells/factories/text.js +5 -0
  123. package/dist-lib/components/fields/cells/factories/timestamp.js +18 -0
  124. package/dist-lib/components/fields/cells/factories/url-helpers.js +49 -0
  125. package/dist-lib/components/fields/cells/factories/url.js +45 -0
  126. package/dist-lib/components/fields/cells/registry.js +58 -0
  127. package/dist-lib/components/fields/index.js +80 -0
  128. package/dist-lib/components/fields/langMap.js +6 -0
  129. package/dist-lib/components/fields/secretValue.js +7 -0
  130. package/dist-lib/components/file-widgets/CircleImage.js +11 -0
  131. package/dist-lib/components/file-widgets/DocumentCard.js +277 -0
  132. package/dist-lib/components/file-widgets/FileList.js +213 -0
  133. package/dist-lib/{Grid-XUHm5SDe.js → components/file-widgets/Grid.js} +45 -40
  134. package/dist-lib/components/file-widgets/GridLazy.js +15 -0
  135. package/dist-lib/components/file-widgets/ImageWidget.js +354 -0
  136. package/dist-lib/components/file-widgets/LabeledSlots.js +69 -0
  137. package/dist-lib/components/file-widgets/SquareImage.js +11 -0
  138. package/dist-lib/components/file-widgets/UnknownFileWidget.js +22 -0
  139. package/dist-lib/components/file-widgets/UploadFailureText.js +10 -0
  140. package/dist-lib/components/file-widgets/WideBanner.js +11 -0
  141. package/dist-lib/components/file-widgets/builtins.js +15 -0
  142. package/dist-lib/components/file-widgets/cropper.js +13 -0
  143. package/dist-lib/components/file-widgets/draft-scope.js +59 -0
  144. package/dist-lib/components/file-widgets/helpers.js +75 -0
  145. package/dist-lib/components/file-widgets/host.js +75 -0
  146. package/dist-lib/{payload-DioMoxMX.js → components/file-widgets/payload.js} +14 -14
  147. package/dist-lib/components/file-widgets/registry.js +13 -0
  148. package/dist-lib/components/file-widgets/upload.js +180 -0
  149. package/dist-lib/components/file-widgets/useEmbedFileSrc.js +45 -0
  150. package/dist-lib/components/file-widgets/value.js +12 -0
  151. package/dist-lib/components/filters/FilterChips.js +123 -0
  152. package/dist-lib/components/filters/FilterConditionValue.js +40 -0
  153. package/dist-lib/components/filters/FilterDrawer.js +670 -0
  154. package/dist-lib/components/filters/FilterOmittedNotice.js +14 -0
  155. package/dist-lib/components/filters/filter-op-label.js +8 -0
  156. package/dist-lib/{CommandPalette.impl-DRI5kxVY.js → components/layout/CommandPalette.impl.js} +62 -61
  157. package/dist-lib/components/layout/CommandPalette.js +12 -0
  158. package/dist-lib/{DirtyTabsCloseDialog.impl-FhAiOmEb.js → components/layout/DirtyTabsCloseDialog.impl.js} +16 -14
  159. package/dist-lib/components/layout/DirtyTabsCloseDialog.js +12 -0
  160. package/dist-lib/{ImpersonationBanner.impl--g0iYwcV.js → components/layout/ImpersonationBanner.impl.js} +4 -3
  161. package/dist-lib/components/layout/ImpersonationBanner.js +12 -0
  162. package/dist-lib/components/layout/ImpersonationFrame.js +29 -0
  163. package/dist-lib/{ImpersonationStartModal.impl-BFBN0YJe.js → components/layout/ImpersonationStartModal.impl.js} +9 -9
  164. package/dist-lib/components/layout/ImpersonationStartModal.js +12 -0
  165. package/dist-lib/components/layout/Layout.js +755 -0
  166. package/dist-lib/components/layout/Rail.js +149 -0
  167. package/dist-lib/components/layout/Sidebar.js +362 -0
  168. package/dist-lib/components/layout/TabStrip.js +321 -0
  169. package/dist-lib/components/layout/TenantChip.js +355 -0
  170. package/dist-lib/components/layout/TopBar.js +305 -0
  171. package/dist-lib/components/layout/tab-close.js +24 -0
  172. package/dist-lib/components/list/ColumnPicker.js +112 -0
  173. package/dist-lib/components/list/InlineEditCell.js +107 -0
  174. package/dist-lib/components/list/PeekFieldCell.js +143 -0
  175. package/dist-lib/components/list/QuickPeek.js +263 -0
  176. package/dist-lib/components/list/ViewSwitcher.js +156 -0
  177. package/dist-lib/components/list/peekDraftStore.js +14 -0
  178. package/dist-lib/{AdminCatalogPage.impl-B-7MLqa1.js → components/pages/AdminCatalogPage.impl.js} +53 -49
  179. package/dist-lib/components/pages/AdminCatalogPage.js +12 -0
  180. package/dist-lib/components/pages/DocumentsMenu.js +150 -0
  181. package/dist-lib/components/pages/ExportMenu.js +123 -0
  182. package/dist-lib/{NotFoundPage.impl-BoX11u-P.js → components/pages/NotFoundPage.impl.js} +6 -4
  183. package/dist-lib/components/pages/NotFoundPage.js +12 -0
  184. package/dist-lib/components/pages/RecordDocumentsPanel.js +230 -0
  185. package/dist-lib/components/pages/RecordNotesPanel.js +200 -0
  186. package/dist-lib/components/pages/RecordPanels.js +18 -0
  187. package/dist-lib/components/pages/SSOCallbackPage.impl.js +28 -0
  188. package/dist-lib/components/pages/SSOCallbackPage.js +12 -0
  189. package/dist-lib/components/pages/SmartDetailPage.impl.js +986 -0
  190. package/dist-lib/components/pages/SmartDetailPage.js +12 -0
  191. package/dist-lib/components/pages/SmartListPage.impl.js +708 -0
  192. package/dist-lib/components/pages/SmartListPage.js +12 -0
  193. package/dist-lib/components/pages/SmartRecordListPage.impl.js +818 -0
  194. package/dist-lib/components/pages/SmartRecordListPage.js +12 -0
  195. package/dist-lib/components/pages/auth/AuthShell.js +350 -0
  196. package/dist-lib/{Forgot.impl-6tL6SBlS.js → components/pages/auth/Forgot.impl.js} +13 -12
  197. package/dist-lib/components/pages/auth/Forgot.js +12 -0
  198. package/dist-lib/{Reset.impl-D0pjhS6d.js → components/pages/auth/Reset.impl.js} +17 -15
  199. package/dist-lib/components/pages/auth/Reset.js +12 -0
  200. package/dist-lib/components/pages/auth/SignIn.js +252 -0
  201. package/dist-lib/{SignUp.impl-CfEXrUeg.js → components/pages/auth/SignUp.impl.js} +31 -27
  202. package/dist-lib/components/pages/auth/SignUp.js +12 -0
  203. package/dist-lib/{TwoFA.impl-B2HtPduH.js → components/pages/auth/TwoFA.impl.js} +9 -8
  204. package/dist-lib/components/pages/auth/TwoFA.js +12 -0
  205. package/dist-lib/components/pages/auth/icons.js +56 -0
  206. package/dist-lib/components/pages/exportRequest.js +17 -0
  207. package/dist-lib/components/pages/list/DataCell.js +27 -0
  208. package/dist-lib/components/pages/list/DeleteViewDialog.js +22 -0
  209. package/dist-lib/{ListCardsBody-BEoYjSZ2.js → components/pages/list/ListCardRow.js} +47 -72
  210. package/dist-lib/components/pages/list/ListCardsBody.js +31 -0
  211. package/dist-lib/components/pages/list/ListFloatbar.js +130 -0
  212. package/dist-lib/components/pages/list/ListFooter.js +138 -0
  213. package/dist-lib/components/pages/list/ListHeader.js +120 -0
  214. package/dist-lib/components/pages/list/ListNoRows.js +72 -0
  215. package/dist-lib/components/pages/list/ListTable.js +191 -0
  216. package/dist-lib/components/pages/list/ListTableRow.js +37 -0
  217. package/dist-lib/components/pages/list/ListToolbar.js +261 -0
  218. package/dist-lib/components/pages/list/ListUrlBanner.js +45 -0
  219. package/dist-lib/components/pages/list/RowActionsCell.js +49 -0
  220. package/dist-lib/components/pages/list/RowContextMenu.js +55 -0
  221. package/dist-lib/components/pages/list/SaveViewDialog.js +111 -0
  222. package/dist-lib/{SortHeaderMenu-Co5PvhTA.js → components/pages/list/SortHeaderMenu.js} +18 -17
  223. package/dist-lib/{cardProjection-Cxlogzh8.js → components/pages/list/cardProjection.js} +3 -3
  224. package/dist-lib/components/pages/list/column-sizing.js +17 -0
  225. package/dist-lib/components/pages/list/columns.js +168 -0
  226. package/dist-lib/components/pages/list/filter-meta.js +84 -0
  227. package/dist-lib/components/pages/list/page-size.js +11 -0
  228. package/dist-lib/components/pages/list/sortable-header.js +18 -0
  229. package/dist-lib/components/pages/list/table-features.js +11 -0
  230. package/dist-lib/components/pages/list/use-filter-value-labels.js +115 -0
  231. package/dist-lib/components/pages/list/useActiveView.js +98 -0
  232. package/dist-lib/components/pages/list/useHeaderReorder.js +93 -0
  233. package/dist-lib/components/pages/list/useListColumnLayout.js +56 -0
  234. package/dist-lib/components/pages/list/useListFilterPresentation.js +34 -0
  235. package/dist-lib/components/pages/list/useListQuery.js +101 -0
  236. package/dist-lib/components/pages/list/useListRowInteraction.js +120 -0
  237. package/dist-lib/components/pages/list/useListSelection.js +53 -0
  238. package/dist-lib/components/pages/list/useListSort.js +44 -0
  239. package/dist-lib/components/pages/list/useListViews.js +148 -0
  240. package/dist-lib/components/pages/list/useRowMenu.js +106 -0
  241. package/dist-lib/components/pages/list/visible-filters.js +19 -0
  242. package/dist-lib/{Preferences.impl-Ct5xwZtT.js → components/pages/profile/Preferences.impl.js} +34 -31
  243. package/dist-lib/components/pages/profile/Preferences.js +12 -0
  244. package/dist-lib/components/pages/profile/Profile.impl.js +437 -0
  245. package/dist-lib/components/pages/profile/Profile.js +12 -0
  246. package/dist-lib/{TenantParamsPage.impl-BGpdmEZg.js → components/pages/tenant-params/TenantParamsPage.impl.js} +45 -40
  247. package/dist-lib/components/pages/tenant-params/TenantParamsPage.js +12 -0
  248. package/dist-lib/components/params/ParamsBlock.js +119 -0
  249. package/dist-lib/{param-editors-TYYU7HKK.js → components/params/param-editors.js} +32 -28
  250. package/dist-lib/components/primitives/Avatar.js +33 -0
  251. package/dist-lib/components/primitives/BoolToggle.js +35 -0
  252. package/dist-lib/components/primitives/BrandGlyph.js +38 -0
  253. package/dist-lib/components/primitives/BrandLogo.js +20 -0
  254. package/dist-lib/components/primitives/Btn.js +67 -0
  255. package/dist-lib/{Check-DAfMbQIw.js → components/primitives/Check.js} +2 -2
  256. package/dist-lib/components/primitives/Chip.js +44 -0
  257. package/dist-lib/components/primitives/ClassifiedFieldLocked.js +15 -0
  258. package/dist-lib/components/primitives/Dropdown.js +85 -0
  259. package/dist-lib/components/primitives/Fields.js +751 -0
  260. package/dist-lib/components/primitives/HoverCard.js +115 -0
  261. package/dist-lib/components/primitives/IconBtn.js +37 -0
  262. package/dist-lib/{Icons-lt-7lhYR.js → components/primitives/Icons.js} +1 -1
  263. package/dist-lib/{Kbd-CNttVu0z.js → components/primitives/Kbd.js} +2 -2
  264. package/dist-lib/components/primitives/MenuItem.js +57 -0
  265. package/dist-lib/{Pill-D-wsfRhx.js → components/primitives/Pill.js} +1 -1
  266. package/dist-lib/{RecordIdBadge-wbigZaFc.js → components/primitives/RecordIdBadge.js} +5 -5
  267. package/dist-lib/components/primitives/RowField.js +47 -0
  268. package/dist-lib/{SectionCard-BYHoHWJc.js → components/primitives/SectionCard.js} +10 -10
  269. package/dist-lib/components/primitives/Spinner.js +31 -0
  270. package/dist-lib/components/primitives/StatTile.js +108 -0
  271. package/dist-lib/components/primitives/Tooltip.js +115 -0
  272. package/dist-lib/{dataTableStyles-vwD1mVOP.js → components/primitives/dataTableStyles.js} +1 -1
  273. package/dist-lib/components/shared/BlankScreen.js +13 -0
  274. package/dist-lib/{ChangePasswordDialog.impl-5hDc0wpE.js → components/shared/ChangePasswordDialog.impl.js} +27 -22
  275. package/dist-lib/{ChangePasswordDialog-C_T_3pjl.js → components/shared/ChangePasswordDialog.js} +2 -2
  276. package/dist-lib/components/shared/ConfirmDialog.js +129 -0
  277. package/dist-lib/components/shared/ConnectionNotice.js +12 -0
  278. package/dist-lib/components/shared/CopyButton.js +25 -0
  279. package/dist-lib/components/shared/DynamicIcon.js +73 -0
  280. package/dist-lib/components/shared/EmptyState.js +56 -0
  281. package/dist-lib/components/shared/ErrorBoundary.js +96 -0
  282. package/dist-lib/components/shared/LoadingSkeleton.js +117 -0
  283. package/dist-lib/components/shared/LucideIcon.js +43 -0
  284. package/dist-lib/components/shared/Markdown.js +15 -0
  285. package/dist-lib/{MarkdownRenderer-sK2TRZS-.js → components/shared/MarkdownRenderer.js} +10 -9
  286. package/dist-lib/components/shared/RefreshControl.js +42 -0
  287. package/dist-lib/components/shared/StatusGroupsDisplay.js +123 -0
  288. package/dist-lib/components/shared/StatusStepper.js +70 -0
  289. package/dist-lib/components/shared/toast/DeclarionToast.js +308 -0
  290. package/dist-lib/components/shared/useOwnRefresh.js +19 -0
  291. package/dist-lib/declarion-react.css +1 -1
  292. package/dist-lib/embed/EmbedAuthBootstrap.js +71 -0
  293. package/dist-lib/embed/EmbedContext.js +38 -0
  294. package/dist-lib/embed/EmbedDirtyReporter.js +17 -0
  295. package/dist-lib/embed/EmbedHistoryTracker.js +17 -0
  296. package/dist-lib/embed/EmbedLocationReporter.js +26 -0
  297. package/dist-lib/embed/EmbedResizeReporter.js +25 -0
  298. package/dist-lib/embed/EmbedUnsavedGuard.js +23 -0
  299. package/dist-lib/embed/embed-dirty.js +21 -0
  300. package/dist-lib/embed/embed-history.js +17 -0
  301. package/dist-lib/embed/embed-nav-guard.js +13 -0
  302. package/dist-lib/embed/file-src.js +60 -0
  303. package/dist-lib/embed/handshake.js +37 -0
  304. package/dist-lib/embed/params.js +45 -0
  305. package/dist-lib/embed/protocol.js +26 -0
  306. package/dist-lib/embed/screen-location.js +44 -0
  307. package/dist-lib/embed/theme.js +11 -0
  308. package/dist-lib/embed/token.js +54 -0
  309. package/dist-lib/embed/useEmbedNavigate.js +65 -0
  310. package/dist-lib/embed/useGlobalLinkInterceptor.js +63 -0
  311. package/dist-lib/hooks/useActionData.js +58 -0
  312. package/dist-lib/hooks/useAgentConversation.js +311 -0
  313. package/dist-lib/hooks/useAggregate.js +18 -0
  314. package/dist-lib/hooks/useAllEntityData.js +53 -0
  315. package/dist-lib/hooks/useAssociatedData.js +37 -0
  316. package/dist-lib/hooks/useAuth.js +56 -0
  317. package/dist-lib/hooks/useBranding.js +18 -0
  318. package/dist-lib/hooks/useBrandingChrome.js +58 -0
  319. package/dist-lib/hooks/useChildrenData.js +33 -0
  320. package/dist-lib/hooks/useColumns.js +44 -0
  321. package/dist-lib/hooks/useConnectionNotice.js +35 -0
  322. package/dist-lib/{useCurrentLocation-Bq1T72AW.js → hooks/useCurrentLocation.js} +2 -2
  323. package/dist-lib/hooks/useCurrentScreen.js +20 -0
  324. package/dist-lib/hooks/useCursorEntityData.js +77 -0
  325. package/dist-lib/hooks/useDebounce.js +11 -0
  326. package/dist-lib/hooks/useEntity.js +8 -0
  327. package/dist-lib/hooks/useEntityData.js +64 -0
  328. package/dist-lib/hooks/useFileReferenceJSON.js +29 -0
  329. package/dist-lib/hooks/useFilters.js +28 -0
  330. package/dist-lib/hooks/useFollowAgentOpen.js +84 -0
  331. package/dist-lib/hooks/useImpersonation.js +40 -0
  332. package/dist-lib/hooks/useIntentPrefetch.js +43 -0
  333. package/dist-lib/hooks/useJsonSnapshot.js +8 -0
  334. package/dist-lib/hooks/useLanguage.js +21 -0
  335. package/dist-lib/hooks/useLiveObject.js +17 -0
  336. package/dist-lib/hooks/useLongPress.js +49 -0
  337. package/dist-lib/hooks/useMutations.js +70 -0
  338. package/dist-lib/{useObject-B45F96rC.js → hooks/useObject.js} +2 -2
  339. package/dist-lib/hooks/useObjectStatus.js +20 -0
  340. package/dist-lib/hooks/usePageState.js +18 -0
  341. package/dist-lib/hooks/usePageStateRuntime.js +46 -0
  342. package/dist-lib/hooks/usePageStateTtl.js +10 -0
  343. package/dist-lib/hooks/useParams.js +123 -0
  344. package/dist-lib/hooks/useProperties.js +32 -0
  345. package/dist-lib/hooks/useRealtimeThresholds.js +31 -0
  346. package/dist-lib/hooks/useRegisterScreenTab.js +28 -0
  347. package/dist-lib/hooks/useResponsiveMode.js +84 -0
  348. package/dist-lib/hooks/useSSE.js +307 -0
  349. package/dist-lib/hooks/useSchema.js +73 -0
  350. package/dist-lib/hooks/useScreen.js +8 -0
  351. package/dist-lib/hooks/useScreenBack.js +60 -0
  352. package/dist-lib/hooks/useScreenTab.js +11 -0
  353. package/dist-lib/hooks/useTabNavigate.js +82 -0
  354. package/dist-lib/hooks/useTabSearchMirror.js +19 -0
  355. package/dist-lib/{useTabTitle-KrzEo118.js → hooks/useTabTitle.js} +9 -7
  356. package/dist-lib/hooks/useText.js +15 -0
  357. package/dist-lib/hooks/useTimelineData.js +44 -0
  358. package/dist-lib/hooks/useUnsavedInput.js +18 -0
  359. package/dist-lib/hooks/useVersionWatcher.js +62 -0
  360. package/dist-lib/hooks/useViews.js +88 -0
  361. package/dist-lib/hooks/useWindowConversation.js +11 -0
  362. package/dist-lib/icons.js +5 -3
  363. package/dist-lib/index.d.ts +42 -20
  364. package/dist-lib/index.js +131 -3926
  365. package/dist-lib/lib/action-dispatch.js +7 -0
  366. package/dist-lib/lib/actions.js +279 -0
  367. package/dist-lib/lib/anchor.js +41 -0
  368. package/dist-lib/lib/brand-tokens.js +95 -0
  369. package/dist-lib/lib/branding.js +25 -0
  370. package/dist-lib/lib/canonical-url.js +17 -0
  371. package/dist-lib/lib/capabilityPrefetch.js +57 -0
  372. package/dist-lib/lib/child-config.js +111 -0
  373. package/dist-lib/lib/children-validation.js +52 -0
  374. package/dist-lib/lib/decimal-text.js +15 -0
  375. package/dist-lib/lib/display-value.js +19 -0
  376. package/dist-lib/lib/document-templates.js +6 -0
  377. package/dist-lib/lib/download.js +41 -0
  378. package/dist-lib/lib/evidence-verdict.js +23 -0
  379. package/dist-lib/lib/failure.js +9 -0
  380. package/dist-lib/lib/field-classification.js +58 -0
  381. package/dist-lib/lib/field-regions.js +13 -0
  382. package/dist-lib/lib/filter-evaluator.js +98 -0
  383. package/dist-lib/lib/filters.js +118 -0
  384. package/dist-lib/lib/format-count.js +24 -0
  385. package/dist-lib/lib/html-state.js +9 -0
  386. package/dist-lib/lib/language.js +52 -0
  387. package/dist-lib/lib/longPressGesture.js +34 -0
  388. package/dist-lib/lib/mass-edit.js +65 -0
  389. package/dist-lib/{page-inset-D_kkVwwN.js → lib/page-inset.js} +1 -1
  390. package/dist-lib/lib/phone.js +28 -0
  391. package/dist-lib/lib/query-retry.js +7 -0
  392. package/dist-lib/lib/quick-add.js +23 -0
  393. package/dist-lib/lib/realtime-query-keys.js +23 -0
  394. package/dist-lib/lib/realtime-reconcile.js +148 -0
  395. package/dist-lib/lib/realtime-resync.js +192 -0
  396. package/dist-lib/lib/record-documents-key.js +4 -0
  397. package/dist-lib/lib/ref-choices.js +6 -0
  398. package/dist-lib/lib/refetch-when-idle.js +25 -0
  399. package/dist-lib/lib/rich-text.js +46 -0
  400. package/dist-lib/lib/rowClickGesture.js +10 -0
  401. package/dist-lib/lib/safe-url.js +34 -0
  402. package/dist-lib/lib/schema-routing.js +51 -0
  403. package/dist-lib/{screen-back-BtbEp5sO.js → lib/screen-back.js} +2 -2
  404. package/dist-lib/lib/scroll-restoration.js +156 -0
  405. package/dist-lib/lib/size-value.js +22 -0
  406. package/dist-lib/lib/sort.js +59 -0
  407. package/dist-lib/lib/timestamp.js +97 -0
  408. package/dist-lib/lib/toast.js +78 -0
  409. package/dist-lib/lib/ui-actions.js +81 -0
  410. package/dist-lib/{utils-D_QDpB8_.js → lib/utils.js} +1 -1
  411. package/dist-lib/lib/variants.js +63 -0
  412. package/dist-lib/lib/versionTracker.js +102 -0
  413. package/dist-lib/lib/viewport-category.js +12 -0
  414. package/dist-lib/{window-election-CHIvIZwx.js → lib/window-election.js} +1 -1
  415. package/dist-lib/stores/auth.js +84 -0
  416. package/dist-lib/stores/icon-registry.js +24 -0
  417. package/dist-lib/stores/list-layout.js +178 -0
  418. package/dist-lib/{page-state-eA6J_KIR.js → stores/page-state.js} +1 -1
  419. package/dist-lib/stores/preferences.js +126 -0
  420. package/dist-lib/stores/realtime.js +115 -0
  421. package/dist-lib/stores/screen-registry.js +10 -0
  422. package/dist-lib/stores/tabs.js +220 -0
  423. package/dist-lib/test/seed-schema.js +8 -0
  424. package/dist-lib/testing.d.ts +1 -1
  425. package/dist-lib/testing.js +80 -76
  426. package/dist-lib/types/api.js +48 -0
  427. package/dist-lib/types/fieldType.js +4 -0
  428. package/dist-lib/types/ordmap.js +50 -0
  429. package/dist-lib/types/schema.js +173 -0
  430. package/dist-lib/{useResponsiveMode-DIR1bZfo.d.ts → useResponsiveMode-DmrpMbZX.d.ts} +44 -16
  431. package/package.json +13 -12
  432. package/dist-lib/ActionRunner-DdBFhqGe.js +0 -1440
  433. package/dist-lib/AgentOpenFollower.impl-BAs_wGEZ.js +0 -81
  434. package/dist-lib/AssociatedBlock-BOoPLOjw.js +0 -1515
  435. package/dist-lib/AuthShell-C8aVwHS7.js +0 -361
  436. package/dist-lib/BlankScreen-DVc7fh8C.js +0 -61
  437. package/dist-lib/CopyButton-DRIT_f0k.js +0 -119
  438. package/dist-lib/DynamicIcon-DuBSz6TZ.js +0 -133
  439. package/dist-lib/FilterChips-Cv1tlXyo.js +0 -1031
  440. package/dist-lib/LayoutRenderer-d-tXYPze.js +0 -3239
  441. package/dist-lib/MenuItem-CfkVXPvC.js +0 -140
  442. package/dist-lib/MonacoJson-BG3S3GHX.js +0 -60
  443. package/dist-lib/Profile.impl-Cypk27ah.js +0 -527
  444. package/dist-lib/PropertyGridEditor-XrP6TZ5s.js +0 -4378
  445. package/dist-lib/RecordHeader-BfQ0_4wq.js +0 -217
  446. package/dist-lib/RefreshControl-CRdWPoF5.js +0 -195
  447. package/dist-lib/SSOCallbackPage.impl-Cfi2pQ59.js +0 -31
  448. package/dist-lib/SmartDetailPage.impl-BiIX0n7K.js +0 -1609
  449. package/dist-lib/SmartListPage.impl-Cu83Gv_G.js +0 -2818
  450. package/dist-lib/SmartRecordListPage.impl-DR6lq7HA.js +0 -795
  451. package/dist-lib/format-count-lyB4CPen.js +0 -943
  452. package/dist-lib/peekDraftStore-CaimrOhW.js +0 -200
  453. package/dist-lib/registry-CGe5kCXN.js +0 -119
  454. package/dist-lib/use-filter-value-labels-D3YDgUzg.js +0 -413
  455. package/dist-lib/useAgentConversation-rru-7hnF.js +0 -612
  456. package/dist-lib/useBranding-zcxEic2k.js +0 -41
  457. package/dist-lib/useBrandingChrome-bxaR3G1R.js +0 -170
  458. package/dist-lib/useCurrentScreen-BZOHBGQZ.js +0 -2522
  459. package/dist-lib/useImpersonation-DBIRRR70.js +0 -35
  460. package/dist-lib/useOwnRefresh-DJjaje52.js +0 -435
  461. package/dist-lib/useParams-BFLJi4n3.js +0 -133
  462. package/dist-lib/useProperties-B7opZ-iy.js +0 -81
  463. package/dist-lib/useScreenBack-DENlz844.js +0 -71
  464. package/dist-lib/useTabNavigate-CUqOmcMj.js +0 -78
  465. package/dist-lib/value-BuQVYx52.js +0 -194
  466. package/dist-lib/variants-vUtfBbE6.js +0 -1961
  467. /package/dist-lib/{JsonEditor-Dz1PQHC8.js → components/fields/JsonEditor.js} +0 -0
@@ -0,0 +1,32 @@
1
+ //#region src/api/access-expiry.ts
2
+ var e = "declarion.auth.access.expiry";
3
+ function t(t) {
4
+ if (t && !Number.isNaN(Date.parse(t))) try {
5
+ window.localStorage.setItem(e, t);
6
+ } catch {
7
+ return;
8
+ }
9
+ }
10
+ function n() {
11
+ try {
12
+ window.localStorage.removeItem(e);
13
+ } catch {
14
+ return;
15
+ }
16
+ }
17
+ function r() {
18
+ try {
19
+ let t = Date.parse(window.localStorage.getItem(e) ?? "");
20
+ return Number.isNaN(t) ? null : t;
21
+ } catch {
22
+ return null;
23
+ }
24
+ }
25
+ function i(e, t) {
26
+ return e === null ? "probe-first" : e > t ? "first-wave" : "refresh-first";
27
+ }
28
+ function a() {
29
+ return i(r(), Date.now());
30
+ }
31
+ //#endregion
32
+ export { n as clearAccessExpiry, t as recordAccessExpiry, i as startOrder, a as startOrderNow };
@@ -0,0 +1,105 @@
1
+ import { callHandler as e } from "./client.js";
2
+ import { listEntities as t } from "./data.js";
3
+ //#region src/api/agents.ts
4
+ async function n() {
5
+ return (await e("agents.list_available", {})).agents ?? [];
6
+ }
7
+ async function r(t) {
8
+ return {
9
+ id: (await e("agent.start_conversation", { ...t.agent_id ? { agent_id: t.agent_id } : {} })).conversation_id,
10
+ status: "active"
11
+ };
12
+ }
13
+ async function i(t, n, r) {
14
+ return {
15
+ id: (await e("agent.send_message", {
16
+ conversation_id: n,
17
+ text: t,
18
+ ...r ? { context: r } : {}
19
+ })).message_id,
20
+ conversation_id: n,
21
+ role: "user"
22
+ };
23
+ }
24
+ async function a(t, n) {
25
+ await e("agent.answer_question", {
26
+ invocation_id: t,
27
+ answer: n
28
+ });
29
+ }
30
+ async function o(e, t, n) {
31
+ await a(t, n);
32
+ }
33
+ async function s(e, t = "call") {
34
+ await a(e, {
35
+ approve: !0,
36
+ scope: t
37
+ });
38
+ }
39
+ async function c(e, t) {
40
+ await a(e, {
41
+ approve: !1,
42
+ ...t ? { note: t } : {}
43
+ });
44
+ }
45
+ async function l(t) {
46
+ await e("agent.cancel_question", { invocation_id: t });
47
+ }
48
+ async function u(t) {
49
+ await e("agent.cancel_conversation", { conversation_id: t });
50
+ }
51
+ async function d() {
52
+ let e = await t("agent_conversation", {
53
+ sort: "updated_at:desc",
54
+ page: 1,
55
+ per_page: 50
56
+ });
57
+ return (e.data ?? []).map((t) => ({
58
+ ...t,
59
+ agent: t.agent_id ? e.$refs?.agent?.[t.agent_id]?.code : void 0
60
+ }));
61
+ }
62
+ async function f(e) {
63
+ return h("agent_turn", {
64
+ filters: [{
65
+ field: "conversation_id",
66
+ op: "eq",
67
+ value: e
68
+ }],
69
+ sort: "runnable_message_seq:asc"
70
+ });
71
+ }
72
+ async function p(e) {
73
+ return h("agent_tool_invocation", {
74
+ filters: [{
75
+ field: "conversation_id",
76
+ op: "eq",
77
+ value: e
78
+ }],
79
+ sort: "created_at:asc"
80
+ });
81
+ }
82
+ async function m(e) {
83
+ return h("agent_message", {
84
+ filters: [{
85
+ field: "conversation_id",
86
+ op: "eq",
87
+ value: e
88
+ }],
89
+ sort: "seq:asc"
90
+ });
91
+ }
92
+ async function h(e, n) {
93
+ let r = [];
94
+ for (let i = 1;; i += 1) {
95
+ let a = await t(e, {
96
+ ...n,
97
+ page: i,
98
+ per_page: 1e3
99
+ }), o = a.data ?? [];
100
+ if (r.push(...o), a.meta?.has_more !== !0) return r;
101
+ if (o.length === 0) throw Error(`${e} pagination did not advance`);
102
+ }
103
+ }
104
+ //#endregion
105
+ export { a as answerQuestion, s as approveInvocation, u as cancelConversation, l as cancelInvocation, r as createConversation, n as listAvailableAgents, d as listConversations, p as loadConversationInvocations, f as loadConversationTurns, m as loadHistory, c as rejectInvocation, o as sendElicitResponse, i as sendMessage };
@@ -0,0 +1,30 @@
1
+ //#region src/api/auth-redirect.ts
2
+ var e = "/login", t = "/signup", n = "https://declarion.local";
3
+ function r(n) {
4
+ let r = n.split(/[?#]/, 1)[0];
5
+ return r === e || r.startsWith(`${e}/`) || r === t || r.startsWith(`${t}/`);
6
+ }
7
+ function i(e) {
8
+ if (!e) return "/";
9
+ let t = e.toLowerCase();
10
+ if (!e.startsWith("/") || e.startsWith("//") || e.includes("\\") || t.includes("%5c")) return "/";
11
+ try {
12
+ let t = new URL(e, n);
13
+ if (t.origin !== n) return "/";
14
+ let r = `${t.pathname}${t.search}${t.hash}`;
15
+ return !r.startsWith("/") || r.startsWith("//") || r.includes("\\") ? "/" : r || "/";
16
+ } catch {
17
+ return "/";
18
+ }
19
+ }
20
+ function a(t) {
21
+ let n = i(t);
22
+ return n === "/" || r(n) ? e : `${e}?next=${encodeURIComponent(n)}`;
23
+ }
24
+ function o() {
25
+ if (typeof window > "u") return e;
26
+ let { pathname: t, search: n, hash: r } = window.location;
27
+ return a(`${t}${n}${r}`);
28
+ }
29
+ //#endregion
30
+ export { o as loginPathForCurrentLocation, a as loginPathForRedirectPath, i as sanitizeRedirectPath };
@@ -0,0 +1,67 @@
1
+ import { callHandler as e, scheduleProactiveRefresh as t } from "./client.js";
2
+ //#region src/api/auth.ts
3
+ async function n() {
4
+ return e("auth.check_setup");
5
+ }
6
+ async function r(n, r, i = !0) {
7
+ let a = await e("auth.login", {
8
+ email: n,
9
+ password: r,
10
+ remember: i
11
+ });
12
+ return t(a.expires_at), a;
13
+ }
14
+ async function i(n, r, i) {
15
+ let a = await e("auth.signup", {
16
+ email: n,
17
+ password: r,
18
+ display_name: i
19
+ });
20
+ return t(a.expires_at), a;
21
+ }
22
+ async function a() {
23
+ return e("auth.me");
24
+ }
25
+ async function o() {
26
+ return e("auth.me", {}, { isSessionProbe: !0 });
27
+ }
28
+ async function s() {
29
+ return (await e("auth.list_tenants")).tenants;
30
+ }
31
+ async function c(n) {
32
+ let r = await e("auth.switch_tenant", { tenant_id: n });
33
+ return t(r.expires_at), r;
34
+ }
35
+ async function l() {
36
+ await e("auth.logout");
37
+ }
38
+ async function u(t) {
39
+ return (await e("sso_provider.list", t ? { tenant_code: t } : {})).providers;
40
+ }
41
+ function d(e, t, n) {
42
+ let r = new URLSearchParams();
43
+ t && r.set("tenant", t), n && r.set("redirect", n);
44
+ let i = r.toString();
45
+ return `/api/auth/sso/authorize/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
46
+ }
47
+ async function f(t, n, r) {
48
+ let i = {
49
+ target_user_id: t,
50
+ reason: n
51
+ };
52
+ return r != null && (i.duration_minutes = r), e("impersonation.start", i);
53
+ }
54
+ async function p() {
55
+ return e("impersonation.stop");
56
+ }
57
+ async function m(t) {
58
+ await e("impersonation.revoke", { session_id: t });
59
+ }
60
+ async function h(t, n) {
61
+ await e("auth.change_password", {
62
+ current_password: t,
63
+ new_password: n
64
+ });
65
+ }
66
+ //#endregion
67
+ export { h as changePassword, n as checkSetup, a as getMe, m as impersonationRevoke, f as impersonationStart, p as impersonationStop, u as listSSOProviders, s as listTenants, r as login, l as logout, o as probeSession, i as signup, d as ssoAuthorizeUrl, c as switchTenant };
@@ -0,0 +1,34 @@
1
+ import { callHandler as e } from "./client.js";
2
+ //#region src/api/batch.ts
3
+ var t = class {
4
+ ops = [];
5
+ call(e, t) {
6
+ return this.ops.push({
7
+ action: e,
8
+ params: n(t)
9
+ }), this;
10
+ }
11
+ upsert(e, t, n = "upsert", r = []) {
12
+ let i = {
13
+ entity: e,
14
+ records: t,
15
+ mode: n
16
+ };
17
+ return r.length > 0 && (i.unique_by = r), this.call("data.upsert", i);
18
+ }
19
+ async execute() {
20
+ if (this.ops.length === 0) throw Error("declarion: batch.execute() called with no ops; add ops via .call() or .upsert()");
21
+ return await e("system.batch", {
22
+ actions: this.ops,
23
+ atomic: !0
24
+ });
25
+ }
26
+ _ops() {
27
+ return this.ops;
28
+ }
29
+ };
30
+ function n(e) {
31
+ return e == null ? null : typeof e == "object" && !Array.isArray(e) ? e : { value: e };
32
+ }
33
+ //#endregion
34
+ export { t as Batch };
@@ -0,0 +1,241 @@
1
+ import { ApiError as e, NetworkError as t, errorCodeOf as n, readProblem as r } from "../types/api.js";
2
+ import { loginPathForCurrentLocation as i } from "./auth-redirect.js";
3
+ import { awaitEmbedToken as a, clearEmbedToken as o, getEmbedToken as s, isEmbedTokenMode as c } from "../embed/token.js";
4
+ import { observe as l } from "../lib/versionTracker.js";
5
+ import { REFRESH_TIMEOUT_MS as u, requestTimeoutMs as d } from "./request-bounds.js";
6
+ import { clearAccessExpiry as f, recordAccessExpiry as p } from "./access-expiry.js";
7
+ //#region src/api/client.ts
8
+ var m = (e) => JSON.stringify(e ?? {}), h = null, g = "declarion.auth.refresh.result", _ = "declarion.auth.refresh";
9
+ function v(e = () => window.localStorage.getItem(g)) {
10
+ try {
11
+ let t = JSON.parse(e() ?? "null");
12
+ return typeof t?.ok == "boolean" && typeof t.updated_at == "number" ? t : null;
13
+ } catch {
14
+ return null;
15
+ }
16
+ }
17
+ function y(e) {
18
+ try {
19
+ window.localStorage.setItem(g, JSON.stringify({
20
+ updated_at: Date.now(),
21
+ ...e
22
+ }));
23
+ } catch {
24
+ return;
25
+ }
26
+ }
27
+ function b(e) {
28
+ return e.ok ? (e.access_expires_at && T(e.access_expires_at), null) : new S(e.status ?? 401);
29
+ }
30
+ async function x() {
31
+ let e = navigator.locks;
32
+ if (!e) {
33
+ await A();
34
+ return;
35
+ }
36
+ let t = Date.now();
37
+ await e.request(_, { mode: "exclusive" }, async () => {
38
+ let e = v();
39
+ if (e && e.updated_at >= t) {
40
+ let t = b(e);
41
+ if (t) throw t;
42
+ } else try {
43
+ y({
44
+ ok: !0,
45
+ access_expires_at: await A()
46
+ });
47
+ } catch (e) {
48
+ throw e instanceof S && y({
49
+ ok: !1,
50
+ status: e.status
51
+ }), e;
52
+ }
53
+ });
54
+ }
55
+ var S = class extends Error {
56
+ status;
57
+ constructor(e) {
58
+ super(`refresh failed terminally (${e})`), this.status = e, this.name = "RefreshDeadError";
59
+ }
60
+ }, C = null;
61
+ function w() {
62
+ return C ??= import("./session-renewal.js").catch((e) => {
63
+ throw C = null, e;
64
+ }), C;
65
+ }
66
+ function T(e) {
67
+ return j = null, c() || p(e), typeof window > "u" ? Promise.resolve() : w().then((t) => t.scheduleRenewal(e), () => void 0);
68
+ }
69
+ function E() {
70
+ f(), C?.then((e) => e.cancelRenewal());
71
+ }
72
+ typeof window < "u" && window.addEventListener("storage", (e) => {
73
+ if (e.key !== g || c()) return;
74
+ let t = v(() => e.newValue);
75
+ t?.ok && t.access_expires_at && T(t.access_expires_at);
76
+ });
77
+ async function D(e, n, r) {
78
+ let i = new AbortController(), a = setTimeout(() => i.abort(), r);
79
+ try {
80
+ return await fetch(e, {
81
+ ...n,
82
+ signal: n.signal ? AbortSignal.any([n.signal, i.signal]) : i.signal
83
+ });
84
+ } catch (r) {
85
+ throw !i.signal.aborted && n.signal?.aborted ? r : new t(i.signal.aborted ? "timeout" : "unreachable", n.method ?? "GET", e, r);
86
+ } finally {
87
+ clearTimeout(a);
88
+ }
89
+ }
90
+ async function O(e) {
91
+ try {
92
+ return (await e.json())?.result?.expires_at;
93
+ } catch {
94
+ return;
95
+ }
96
+ }
97
+ function k() {
98
+ return D("/api/actions/auth.refresh", {
99
+ method: "POST",
100
+ credentials: "include",
101
+ headers: { "Content-Type": "application/json" },
102
+ body: m({})
103
+ }, u);
104
+ }
105
+ async function A() {
106
+ let t = await k();
107
+ if (t.status === 429) {
108
+ let e = parseInt(t.headers.get("Retry-After") || "1", 10);
109
+ await r(t), await new Promise((t) => setTimeout(t, e * 1e3)), t = await k();
110
+ }
111
+ if (t.status >= 500) {
112
+ let n = await r(t);
113
+ throw new e(t.status, n.body, n.raw);
114
+ }
115
+ if (!t.ok) throw await r(t), new S(t.status);
116
+ let n = await O(t);
117
+ return T(n), n;
118
+ }
119
+ var j = null;
120
+ function M(n) {
121
+ return n instanceof t || n instanceof e;
122
+ }
123
+ async function N() {
124
+ if (j !== null) throw new S(j);
125
+ return h || (h = x().catch((e) => {
126
+ throw e instanceof S && (j = e.status), e;
127
+ }).finally(() => {
128
+ h = null;
129
+ }), h);
130
+ }
131
+ var P = () => {
132
+ if (typeof window > "u") return;
133
+ let { pathname: e } = window.location;
134
+ e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || e === "/2fa" || (window.location.href = i());
135
+ };
136
+ function F(e) {
137
+ let t = P;
138
+ return P = e, t;
139
+ }
140
+ function I() {
141
+ return P;
142
+ }
143
+ var L = ({ status: e, code: t, message: n }) => {
144
+ console.error(`[API ${e}] ${t}: ${n}`);
145
+ };
146
+ function R(e, t, n, r) {
147
+ let i = new Headers(e);
148
+ return !i.has("Content-Type") && t && i.set("Content-Type", "application/json"), n.setAccept && !i.has("Accept") && i.set("Accept", "*/*"), r && i.set("Authorization", `Bearer ${r}`), i;
149
+ }
150
+ var z = null, B = 0;
151
+ function V(e) {
152
+ e || B++, z = e || null;
153
+ }
154
+ function H() {
155
+ return B;
156
+ }
157
+ function U(e, t) {
158
+ e === B && (z = t || null);
159
+ }
160
+ function W() {
161
+ return z;
162
+ }
163
+ function G(e) {
164
+ return !z || !e.startsWith("/api/") || /[?&]language=/.test(e) ? e : `${e}${e.includes("?") ? "&" : "?"}language=${encodeURIComponent(z)}`;
165
+ }
166
+ async function K(t, i, u, f) {
167
+ let p = G(t), m = c(), h = m ? "omit" : "include", g = R(i.headers, !!i.body, u, m ? s() : null), _ = d(t, i), v = await D(p, {
168
+ ...i,
169
+ headers: g,
170
+ credentials: h
171
+ }, _);
172
+ if (l(v.headers), !v.ok) {
173
+ let { raw: t, body: s } = await r(v), c = n(s.type), l = s.title ?? "";
174
+ if (v.status === 401 && (c === "auth.token_refresh_needed" || c === "auth.unauthorized")) try {
175
+ let t = null;
176
+ m ? (o(), t = await a()) : await N();
177
+ let n = R(i.headers, !!i.body, u, t), s = await D(p, {
178
+ ...i,
179
+ headers: n,
180
+ credentials: h
181
+ }, _);
182
+ if (!s.ok) {
183
+ s.status === 401 && !u.isSessionProbe && P();
184
+ let t = await r(s);
185
+ throw new e(s.status, t.body, t.raw);
186
+ }
187
+ return f(s);
188
+ } catch (n) {
189
+ throw M(n) ? n : (u.isSessionProbe || P(), new e(401, s, t));
190
+ }
191
+ throw v.status === 401 && !u.isSessionProbe && P(), L({
192
+ status: v.status,
193
+ code: c,
194
+ message: l
195
+ }), new e(v.status, s, t);
196
+ }
197
+ return f(v);
198
+ }
199
+ function q(e) {
200
+ return e.status === 204 ? Promise.resolve(void 0) : e.json();
201
+ }
202
+ async function J(e, t = {}, { isSessionProbe: n = !1 } = {}) {
203
+ return K(e, t, {
204
+ setAccept: !1,
205
+ isSessionProbe: n
206
+ }, q);
207
+ }
208
+ async function Y(e) {
209
+ return {
210
+ blob: await e.blob(),
211
+ filename: Z(e.headers),
212
+ headers: e.headers
213
+ };
214
+ }
215
+ async function X(e, t = {}) {
216
+ return K(e, t, {
217
+ setAccept: !0,
218
+ isSessionProbe: !1
219
+ }, Y);
220
+ }
221
+ function Z(e) {
222
+ let t = e.get("Content-Disposition");
223
+ if (!t) return "";
224
+ let n = t.match(/filename\*\s*=\s*([^']*)'([^']*)'([^;]+)/i);
225
+ if (n) try {
226
+ return decodeURIComponent(n[3].trim());
227
+ } catch {}
228
+ let r = t.match(/filename\s*=\s*("([^"]+)"|([^;]+))/i);
229
+ return r ? (r[2] ?? r[3] ?? "").trim() : "";
230
+ }
231
+ async function Q(e, t = {}, { isSessionProbe: n = !1 } = {}) {
232
+ return (await K(`/api/actions/${encodeURIComponent(e)}`, {
233
+ method: "POST",
234
+ body: m(t)
235
+ }, {
236
+ setAccept: !1,
237
+ isSessionProbe: n
238
+ }, q)).result;
239
+ }
240
+ //#endregion
241
+ export { S as RefreshDeadError, J as apiFetch, X as apiFetchBlob, Q as callHandler, E as cancelProactiveRefresh, W as currentPublishedLanguage, H as currentReader, N as ensureRefresh, I as getPersistentAuthFailureHandler, M as isTransientFailure, Z as parseContentDispositionFilename, V as publishLanguage, U as publishLanguageFor, T as scheduleProactiveRefresh, F as setPersistentAuthFailureHandler, G as withPublishedLanguage };
@@ -0,0 +1,122 @@
1
+ import { ApiError as e } from "../types/api.js";
2
+ import { apiFetch as t, apiFetchBlob as n } from "./client.js";
3
+ //#region src/api/data.ts
4
+ function r(e, t) {
5
+ let n = new URL(`/api/data/${e}`, window.location.origin);
6
+ if (t.page && n.searchParams.set("page", String(t.page)), t.per_page && n.searchParams.set("per_page", String(t.per_page)), t.sort && n.searchParams.set("sort", t.sort), t.search && n.searchParams.set("search", t.search), t.filters && t.filters.length > 0 && n.searchParams.set("filters", JSON.stringify(t.filters)), t.include_deleted && n.searchParams.set("include_deleted", "true"), t.expand) for (let e of t.expand) n.searchParams.append("expand", e);
7
+ return t.select && t.select.length > 0 && n.searchParams.set("select", t.select.join(",")), t.screen && n.searchParams.set("screen", t.screen), t.preview && n.searchParams.set("preview", "true"), t.count && n.searchParams.set("count", t.count), n.pathname + n.search;
8
+ }
9
+ async function i(e, n = {}, i = {}) {
10
+ if (y) {
11
+ let t = y(e, n);
12
+ if (t !== void 0) return t;
13
+ }
14
+ return t(r(e, n), { signal: i.signal });
15
+ }
16
+ async function a(e, n, r = {}) {
17
+ let i = new URLSearchParams({ aggregate: n.aggregate.join(",") });
18
+ return n.group_by && i.set("group_by", n.group_by), n.filters && n.filters.length > 0 && i.set("filters", JSON.stringify(n.filters)), n.search && i.set("search", n.search), n.screen && i.set("screen", n.screen), n.include_deleted && i.set("include_deleted", "true"), t(`/api/data/${e}?${i.toString()}`, { signal: r.signal });
19
+ }
20
+ async function o(e, n, r = {}) {
21
+ if (b) {
22
+ let t = b(e, n);
23
+ if (t !== void 0) return t;
24
+ }
25
+ let i = new URLSearchParams();
26
+ if (typeof n == "string") i.set("id", n);
27
+ else for (let [e, t] of Object.entries(n)) i.set(e, t);
28
+ return r.expand?.length && i.set("expand", r.expand.join(",")), t(`/api/data/${e}?${i.toString()}`);
29
+ }
30
+ async function s(e, t) {
31
+ return { data: ((await C(`${e}.__create`, {
32
+ entity: e,
33
+ fields: t
34
+ })).result?.rows ?? [])[0] };
35
+ }
36
+ async function c(e, t, n) {
37
+ let r = typeof t == "string" ? t : u(t);
38
+ return { data: ((await C(`${e}.__update`, {
39
+ object_ids: [r],
40
+ entity: e,
41
+ fields: n
42
+ })).result?.rows ?? [])[0] };
43
+ }
44
+ async function l(e, t) {
45
+ let n = typeof t == "string" ? t : u(t);
46
+ await C(`${e}.__delete`, {
47
+ object_ids: [n],
48
+ entity: e
49
+ });
50
+ }
51
+ function u(e) {
52
+ let t = Object.values(e);
53
+ return t.length === 1 ? t[0] : t.join("");
54
+ }
55
+ async function d(e, t) {
56
+ let n = typeof t == "string" ? t : u(t);
57
+ await C(`${e}.__restore`, {
58
+ object_ids: [n],
59
+ entity: e
60
+ });
61
+ }
62
+ async function f(e, t) {
63
+ let r = await n(`/api/data/${e}/export`, {
64
+ method: "POST",
65
+ body: JSON.stringify(t)
66
+ });
67
+ return {
68
+ blob: r.blob,
69
+ filename: r.filename
70
+ };
71
+ }
72
+ function p(e) {
73
+ return !!e && ((e.failed_count ?? 0) > 0 || (e.timed_out_count ?? 0) > 0);
74
+ }
75
+ var m = class extends Error {
76
+ status;
77
+ response;
78
+ constructor(e, t) {
79
+ super(t.errors?.[0]?.error?.title ?? ""), this.name = "ActionBatchError", this.status = e, this.response = t;
80
+ }
81
+ };
82
+ function h(e) {
83
+ if (!e || typeof e != "object") return !1;
84
+ let t = e;
85
+ return typeof t.status == "string" && Array.isArray(t.errors);
86
+ }
87
+ function g(e, t) {
88
+ let n = { ...e ?? {} };
89
+ if ("object_ids" in n) throw Error("handler param \"object_ids\" collides with reserved key");
90
+ return t !== void 0 && (n.object_ids = t), n;
91
+ }
92
+ var _ = null;
93
+ function v(e) {
94
+ let t = _;
95
+ return _ = e, t;
96
+ }
97
+ var y = null, b = null;
98
+ function x(e) {
99
+ let t = y;
100
+ return y = e, t;
101
+ }
102
+ function S(e) {
103
+ let t = b;
104
+ return b = e, t;
105
+ }
106
+ async function C(n, r) {
107
+ if (_) return _(n, r);
108
+ try {
109
+ return await t(`/api/actions/${n}`, {
110
+ method: "POST",
111
+ body: JSON.stringify(r)
112
+ });
113
+ } catch (t) {
114
+ throw t instanceof e && h(t.raw) ? new m(t.status, t.raw) : t;
115
+ }
116
+ }
117
+ async function w(e, n) {
118
+ let r = new URLSearchParams();
119
+ return r.set("ids", n.join(",")), t(`/api/associations/${e}?${r.toString()}`);
120
+ }
121
+ //#endregion
122
+ export { m as ActionBatchError, a as aggregateEntities, g as buildActionBody, s as createEntity, l as deleteObject, u as encodeObjectId, p as eventsFailed, C as executeAction, f as exportEntities, o as getEntity, i as listEntities, w as resolveAssociation, d as restoreObject, v as setActionExecutor, S as setGetEntityResolver, x as setListEntitiesResolver, c as updateEntity };